package com.zhz.livegoods.details.mapper.impl;

import com.zhz.livegoods.details.mapper.ItemMapper;
import com.zhz.livegoods.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Repository;

/**
 * 查询商品详情实现
 * @author zhz
 * @date 2020/08/05
 **/
@Repository
public class ItemMapperImpl implements ItemMapper {

    @Autowired
    private MongoTemplate mongoTemplate;

    /**
     * 根据Id查询商品
     * @param id
     * @return
     */
    @Override
    public Item findItemById(String id) {
        return mongoTemplate.findById(id,Item.class);
    }
}
